<?php
!defined('P_W') && exit('Forbidden');
define('AREA_SCR','video');
InitGP(array('hid','id'),'',2);
if (!$hid && !$id) Showmsg('undefined_action1');
$videoService = House::loadClass('video'); /* @var $videoService PW_Video */
if ($id) {
	$currentVideo = $videoService->getVideo($id);
	if (!$currentVideo) Showmsg('undefined_action2');
	$hid = $currentVideo['hid'];
	$videos = $videoService->getVideos($hid,'all');
} else {
	$videos = $videoService->getVideos($hid,'all');
	if ($videos) {
		reset($videos);
		$currentVideo = current($videos);
		$id = $currentVideo['id'];
	}
}

$houseService = house::loadClass('house');/* @var $houseService PW_House */
$houseService->setHid($hid);
if (!$houseService->init(true)) {
	Showmsg('该楼盘不存在!');
}
$houseService->setNav();
$houseService->setBanner();
$houseService->updateHits();
$houseinfo = & $houseService->info;

$basename = $houseBaseUrl.'q=info&hid='.$hid;
$imageTypeUrl = $houseBaseUrl.'&q=album&hid='.$hid;

/* SEO */
$_definedSeo = array('title' => $houseinfo['seotitle'] , 'metaDescription' => $houseinfo['seokeywords'] , 'metaKeywords' => $houseinfo['seodescription'] );
$_seopage = 'read';
$_seoname = $houseinfo['name'];

require_once(M_P.'require/header.php');
require_once PrintEot('video');
?>